const { Sequelize } = require("sequelize");
const { sqlLogger } = require("../logger");
const dbConfig = require("../config/dbConfig");

const sequelize = new Sequelize(dbConfig.database, dbConfig.username, dbConfig.password, {
  host: dbConfig.host,
  dialect: dbConfig.dialect,
  logging: (msg) => {
    sqlLogger.debug(msg);
  },
});

module.exports = sequelize;